import i18n from '@/i18n'
import { ApiProperty } from '@nestjs/swagger'
import { MetaResourceModelDataType, MetaResourceModelType, MetaResourceRelativeType } from '@prisma/client'

export class MetaResourceModel {
  static ApiPropertyEnum = {
    MetaResourceModelType: [
      i18n.t('app-meta.model.meta-resource-model.1215086-0', { args: [MetaResourceModelType.Request] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-1', { args: [MetaResourceModelType.Response] }),
    ],
    MetaResourceModelDataType: [
      i18n.t('app-meta.model.meta-resource-model.1215086-2', { args: [MetaResourceModelDataType.Number] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-3', { args: [MetaResourceModelDataType.String] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-4', { args: [MetaResourceModelDataType.Boolean] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-5', { args: [MetaResourceModelDataType.Enum] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-6', { args: [MetaResourceModelDataType.Timestamp] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-7', { args: [MetaResourceModelDataType.Array] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-8', { args: [MetaResourceModelDataType.Object] }),
    ],
    MetaResourceRelativeType: [
      i18n.t('app-meta.model.meta-resource-model.1215086-9', { args: [MetaResourceRelativeType.ModuleAction] }),
      i18n.t('app-meta.model.meta-resource-model.1215086-10', { args: [MetaResourceRelativeType.Chart] }),
    ],
  }

  @ApiProperty({ description: 'ID', type: Number })
  id: number

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-model.1215086-11'), type: String })
  name: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-model.1215086-12'), type: String })
  label: string

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-resource-model.1215086-13'),
    enum: MetaResourceModel.ApiPropertyEnum.MetaResourceModelType,
  })
  type: MetaResourceModelType

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-resource-model.1215086-14'),
    enum: MetaResourceModel.ApiPropertyEnum.MetaResourceModelDataType,
  })
  dataType: MetaResourceModelDataType

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-model.1215086-15'), type: Date })
  createTime: Date

  @ApiProperty({ description: i18n.t('app-meta.model.meta-resource-model.1215086-16'), type: Number })
  relativeId: number

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-resource-model.1215086-17'),
    enum: MetaResourceModel.ApiPropertyEnum.MetaResourceRelativeType,
  })
  relativeType: MetaResourceRelativeType
}
